<template>
  <div>创建10个a标签，点击弹出对应的序号</div>
</template>

<script setup lang="ts">
for (let i = 0; i < 10; i++) {
  let a
  a = document.createElement('a')
  a.innerHTML = i + '<br/>'
  a.addEventListener('click', e => {
    e.preventDefault()
    alert(i)
  })
  document.body.appendChild(a)
}
</script>

<style scoped></style>
